package energy;

public class EnergyData {

	public int seqno;
	public int time;
	public byte flags;
	public byte state;
	public double current;
	
	public EnergyData(int seqno, int time, byte flags) {
		this.seqno = seqno;
		this.time = time;
		this.flags = flags;
		this.state = 0;
		this.current = 0;
	}
	
	public EnergyData(long seqno, long time, byte state) {
		this(Integer.parseInt(""+seqno), Integer.parseInt(""+time), state);
	}
	
/*	@Override
	public EnergyData clone() {
		return new EnergyData(time, state);
	}*/
	
	@Override
	public String toString() {
		return "[" + getClass().getName() + ": seqno="+seqno+", time=" + time + ", flags=" + ((flags & 1<<2)!=0?1:0)  + ((flags & 1<<1)!=0?1:0) + ((flags & 1<<0)!=0?1:0) + ", state="+state+", current=" + current + "] "; 
	}
	
	public int getSeqno() {
		return seqno;
	}
	
	public int getTime() {
		return time;
	}
	
	public byte getState() {
		return state;
	}
	
	public double getCurrent() {
		return state;
	}
}
